import { DECREATEMENT, INCREATEMENT } from '../constant'

// 专门用于创建action对象
export const createIncreatementAction = data => ( { type: INCREATEMENT, data } )
export const createDecreatementAction = data => ( { type: DECREATEMENT, data } )

// 创建异步action
export const createIncreatmentAsyncAction = ( data, time ) => {
    return ( dispatch ) => {
        setTimeout(() => {
            dispatch( createIncreatementAction( data ) )
        }, time);
    }
}